﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MegavaniaX
{
    /// <summary>
    /// Interface for classes with the capability to dispatch local events (not global events,
    /// which are handled by the <typeparamref name="MessagingSystem"/>.
    /// </summary>
    public interface IEventDispatcher
    {
        /// <summary>
        /// Subscribes the given listener to events of type <typeparamref name="MegavaniaEventType"/>.
        /// </summary>
        /// <param name=param name="callback">The callback that will be executed.</param>
        /// <param name="type">The type of event to listen to.</param>
        void Subscribe(MegavaniaEventCallback callback, MegavaniaEventType type, string name);

        /// <summary>
        /// Dispatches an event to any subscribed listeners.
        /// </summary>
        /// <param name="evt">The event to dispatch.</param>
        void DispatchEvent(IMegavaniaEvent evt);

    }
}
